﻿using System;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Events;
using UnityEngine.UI;

namespace Sizebox.CharacterEditor
{
	// Token: 0x02000252 RID: 594
	public class MaterialTextureToggle : MaterialControlOption
	{
		// Token: 0x06000CE3 RID: 3299 RVA: 0x00067D6C File Offset: 0x00065F6C
		private void Awake()
		{
			this.toggle.onValueChanged.AddListener(new UnityAction<bool>(this.OnTextureToggle));
		}

		// Token: 0x06000CE4 RID: 3300 RVA: 0x00067D8A File Offset: 0x00065F8A
		public override void ValidateOption(MaterialEntryGui selected, List<MaterialEntryGui> newGuis)
		{
			base.ValidateOption(selected, newGuis);
			if (this.selectedGui == null)
			{
				return;
			}
			this.toggle.isOn = this.selectedGui.Wrapper.RemoveTexture;
		}

		// Token: 0x06000CE5 RID: 3301 RVA: 0x00067DC4 File Offset: 0x00065FC4
		private void OnTextureToggle(bool value)
		{
			if (this.selectedGuis == null)
			{
				return;
			}
			foreach (MaterialEntryGui materialEntryGui in this.selectedGuis)
			{
				materialEntryGui.Wrapper.RemoveTexture = value;
			}
		}

		// Token: 0x040011E3 RID: 4579
		[SerializeField]
		private Toggle toggle;
	}
}
